new Vue({
        el:"#app",
        data(){
            return{
                fullimage:["../static/trashimage/bluetrash.png","../static/trashimage/fulltrash.png"],
                fireimage:["../static/trashimage/greentrash.png","../static/trashimage/firetrash.png"],
                fallimage:["../static/trashimage/bluetrash.png","../static/trashimage/falltrash.png"],
                batimage:["../static/trashimage/nomalele.png","../static/trashimage/lowele.png"],
                fullstute:["未满","已满"],
                firestute:["正常","着火"],
                fallstute:["正常","倾倒"],
                fullindex:0,
                fireindex:0,
                fallindex:0,
                batindex:0,
                distance:0,
            }
        },
        methods:{
            refresh: function () {
                $.ajax({
                    url:'/test/',
                    type:'GET',
                    success:(data) => {
                        let obj=eval("(" + data + ")");
                        if (this.fullindex!=obj.full||this.fireindex!=obj.fire||this.fallindex!=obj.fall||this.batindex!=obj.bat||this.distance!=obj.distance) {
                            this.fullindex=obj.full;
                            this.fireindex=obj.fire;
                            this.fallindex=obj.fall;
                            this.batindex=obj.bat;
                            this.distance=obj.distance;
                        }
                    }
                });
        }
        },
        created(){
            this.refresh();
            setInterval(this.refresh,5000)
        }
    });
        new Vue({
        el: "#time",
        data(){
            return{
                dates:'',
            }
        },
        created() {
            var ggPoint = new BMap.Point(114.4024,30.4780);
            var map = new BMap.Map("allmap");
            map.centerAndZoom(ggPoint, 17);
            map.enableScrollWheelZoom();
            map.addControl(new BMap.NavigationControl());
            var marker = new BMap.Marker(ggPoint);// 创建标注
	        map.addOverlay(marker);
            let date=new Date();
            this.dates=date.toLocaleString();
            setInterval(() => {
                date = new Date();
                this.dates=date.toLocaleString();
            }, 1000)
        }
    })